package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TDingtalkMessageMapper;
import com.ruoyi.system.domain.TDingtalkMessage;
import com.ruoyi.system.service.ITDingtalkMessageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工单钉钉消息通知记录Service业务层处理
 * 
 * @author wuym
 * @date 2021-04-24
 */
@Service
public class TDingtalkMessageServiceImpl implements ITDingtalkMessageService 
{
    @Autowired
    private TDingtalkMessageMapper tDingtalkMessageMapper;

    /**
     * 查询工单钉钉消息通知记录
     * 
     * @param id 工单钉钉消息通知记录ID
     * @return 工单钉钉消息通知记录
     */
    @Override
    public TDingtalkMessage selectTDingtalkMessageById(Long id)
    {
        return tDingtalkMessageMapper.selectTDingtalkMessageById(id);
    }

    /**
     * 查询工单钉钉消息通知记录列表
     * 
     * @param tDingtalkMessage 工单钉钉消息通知记录
     * @return 工单钉钉消息通知记录
     */
    @Override
    public List<TDingtalkMessage> selectTDingtalkMessageList(TDingtalkMessage tDingtalkMessage)
    {
        return tDingtalkMessageMapper.selectTDingtalkMessageList(tDingtalkMessage);
    }

    /**
     * 新增工单钉钉消息通知记录
     * 
     * @param tDingtalkMessage 工单钉钉消息通知记录
     * @return 结果
     */
    @Override
    public int insertTDingtalkMessage(TDingtalkMessage tDingtalkMessage)
    {
        tDingtalkMessage.setCreateTime(DateUtils.getNowDate());
        return tDingtalkMessageMapper.insertTDingtalkMessage(tDingtalkMessage);
    }

    /**
     * 修改工单钉钉消息通知记录
     * 
     * @param tDingtalkMessage 工单钉钉消息通知记录
     * @return 结果
     */
    @Override
    public int updateTDingtalkMessage(TDingtalkMessage tDingtalkMessage)
    {
        tDingtalkMessage.setUpdateTime(DateUtils.getNowDate());
        return tDingtalkMessageMapper.updateTDingtalkMessage(tDingtalkMessage);
    }

    /**
     * 删除工单钉钉消息通知记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTDingtalkMessageByIds(String ids)
    {
        return tDingtalkMessageMapper.deleteTDingtalkMessageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工单钉钉消息通知记录信息
     * 
     * @param id 工单钉钉消息通知记录ID
     * @return 结果
     */
    @Override
    public int deleteTDingtalkMessageById(Long id)
    {
        return tDingtalkMessageMapper.deleteTDingtalkMessageById(id);
    }
}
